var commonObj={
    setHtmlTitle(){
        var title=document.querySelector("#app-title")
        title.innerHTML="新机场高速巡查管理系统"
    },
    
    //加载地图初始化资源
    loadSource(){
        var head=document.querySelector("head")
        var script=document.createElement("script")
        script.src="http://47.105.166.32:6081/dojo/dojo.js"

        var link=document.createElement("link")
        link.rel="stylesheet"
        link.href="http://47.105.166.32:6081/esri/themes/light/main.css"

        
        head.appendChild(script) 
        head.appendChild(link)
    },
	
	//表格高度随着窗口自适应
	setTableHeight(){
		window.addEventListener("resize",()=>{
			var el=document.querySelector(".el-table");
			var pHeight=el.parentNode.offsetHeight;
			var ethw=el.querySelector(".el-table__header-wrapper");
			if(!ethw){return}
			var tableHeadHeight=ethw.offsetHeight;
			var tablebody=el.querySelector(".el-table__body-wrapper");
			if(tablebody && pHeight>0){
				tablebody.style.height=pHeight-tableHeadHeight +"px";
				tablebody.style.overflowY="auto"
			}
		},false)
	}
}

//commonObj.setHtmlTitle()
// commonObj.loadSource()
commonObj.setTableHeight();